<template>
  <div class="nav-bar">
    <div class="left" @click="goBack">
      <slot name="left">
        <i class="iconfont icon-lift"></i>
      </slot>
    </div>
    <div class="center">
      <slot>EWShop</slot>
    </div>
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script lang="ts" setup>
import {useRouter} from "vue-router";

const router = useRouter();
function goBack(){
  router.go(-1);
}
</script>

<style scoped>
@import '@/assets/css/icon/iconfont.css';
.nav-bar {
  background-color: hsla(160, 100%, 37%, 1);
  color: #fff;
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 9;
  height: 48px;
  line-height: 48px;
  text-align: center;
  box-shadow: 0 2px 0px rgba(100, 100, 100, 0.1);
}

.left, .right {
  width: 60px;
  padding:0 12px;
}

.center {
  flex: 1;
}


</style>